<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p id="p">讲究啊</p>
    <input type="button" value="变化" id="btn2">
    <script type="text/javascript">
        //点击按钮，修改p标签内容
        //获取按钮
        var btn = document.getElementById('btn2');
        //绑定点击事件
        btn.onclick = function() {
            //事件处理函数中，获取p标签，修改内容
            var p = document.getElementById('p');
            // console.log(p.innerHTML);
            p.innerHTML = '不讲究了'
        }
    </script>
</body>

</html>